package cn.tuling.controller;

import cn.tuling.entity.DO.Order;
import cn.tuling.entity.DO.Product;
import cn.tuling.feign.FeignProductFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
    @Autowired
    private FeignProductFeignClient productFeignClient;

    @GetMapping("/order/{oid}")
    public Order getOrder(@PathVariable Integer oid) {
        Product product = productFeignClient.getProduct(1);

        return new Order(oid, "奇怪的订单", product, "支付完成");
    }
}
